[Unit]
Description=prometheus
Requires=network-online.target
After=time-sync.target network-online.target
Wants=time-sync.target

[Service]
Type=simple
User={{ owner }}
Group={{ group }}
Restart=on-failure
RestartSec=30
ExecStart={{ prometheus_install_path }}/prometheus/prometheus \
--config.file={{ prometheus_install_path }}/prometheus/prometheus.yml \
--web.config.file={{ prometheus_install_path }}/prometheus/web-config.yml \
--web.listen-address=:{{ prometheus_port }} \
--storage.tsdb.path={{ prometheus_log_path }} \
--web.enable-lifecycle \
--storage.tsdb.retention.time=15d
# Minus means that this file is optional.
LimitCORE=infinity
LimitNOFILE=500000
CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK CAP_SYS_NICE

[Install]
WantedBy=multi-user.target
